﻿using UnityEngine;
using System.Collections;
using FairyGUI;
using Project.UI;
using Project.controller;

public class UIItemPageView : ViewController {

    public static string Package = "Project";
    public static string ResName = "Item";

    RenderImage _renderImage;

    public override void ViewDidLoad(FairyGUI.Utils.XML xml)
    {
        base.ViewDidLoad(xml);
        Init();
    }

    void Init()
    {
        _renderImage = new RenderImage(GetChild("holder").asGraph);
        _renderImage.SetBackground(GetChild("n0"), GetChild("n1"));
        show();
    }

    void show()
    {
        _renderImage.LoadModel("npc/Ami");
        _renderImage.modelRoot.localPosition = new Vector3(0, -1f, 7f);
        _renderImage.modelRoot.localScale = new Vector3(1, 1, 1);
        _renderImage.modelRoot.localRotation = Quaternion.Euler(0, 160, 0);
    }

    public void SetData()
    {
 
    }

    public void SetBigSize()
    {
        _renderImage.modelRoot.localScale = new Vector3(1.5f, 1.5f, 1.5f);
    }

    public void SetSmallSize()
    {
        _renderImage.modelRoot.localScale = new Vector3(1, 1, 1);
    }
}
